﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataFrameworkAccess.Entity;
using System.Data;
using Back.Xinkui.Common.Enum;
using Back.Xinkui.Common;
using Xinkui.Common.FileAction;
using Xinkui.Common.Enum;

namespace Back.Xinkui.Entity.Buylead
{
    public class BuyleadListEntity
    {
        [DataMapping("BuyleadID", DbType.Int32)]
        public int BuyleadID { get; set; }

        [DataMapping("Subject", DbType.String)]
        public string Subject { set; get; }

        [DataMapping("CategoryID", DbType.Int32)]
        public int CategoryID { get; set; }

        [DataMapping("MainKeyword", DbType.String)]
        public string MainKeyword { set; get; }

        [DataMapping("Keywords", DbType.String)]
        public string Keywords { set; get; }

        [DataMapping("PurchaseType", DbType.Int32)]
        public EPurchaseType PurchaseType { set; get; }

        public string viewPurchaseType
        {
            get
            {
                return EnumHelper.PurchaseTypeEnumToString(PurchaseType);
            }
        }

        [DataMapping("Details", DbType.String)]
        public string Details { set; get; }

        [DataMapping("OEMNO", DbType.String)]
        public string OEMNO { set; get; }

        [DataMapping("Packing", DbType.String)]
        public string Packing { set; get; }

        [DataMapping("Quantity", DbType.String)]
        public string Quantity { set; get; }

        [DataMapping("ValidDate", DbType.DateTime)]
        public DateTime ValidDate { set; get; }

        [DataMapping("ValidTime", DbType.Int32)]
        public int ValidTime { set; get; }

        [DataMapping("PriceRange", DbType.String)]
        public string PriceRange { set; get; }

        [DataMapping("CertificationRequirements", DbType.String)]
        public string CertificationRequirements { set; get; }

        [DataMapping("OrderQuantity", DbType.String)]
        public string OrderQuantity { set; get; }

        [DataMapping("CompanyID", DbType.Int32)]
        public int CompanyID { set; get; }

        [DataMapping("CompanyName", DbType.String)]
        public string CompanyName { set; get; }

        [DataMapping("CreateDate", DbType.DateTime)]
        public DateTime CreateDate { set; get; }

        [DataMapping("UpdateDate", DbType.DateTime)]
        public DateTime UpdateDate { set; get; }

        public string viewCreateDate
        {
            get
            {
                return CreateDate.ToString("yyyy-MM-dd");
            }
        }

        [DataMapping("AuditStatus", DbType.Int32)]
        public EAuditStatus AuditStatus { get; set; }

        public string viewAuditStatus
        {
            get
            {
                return EnumHelper.EnumToString(AuditStatus);
            }
        }

        [DataMapping("AdminID", DbType.Int32)]
        public int AdminID { set; get; }

        [DataMapping("Country", DbType.Int32)]
        public int Country { set; get; }

        [DataMapping("Email", DbType.String)]
        public string Email { set; get; }

        [DataMapping("FirstName", DbType.String)]
        public string FirstName { set; get; }

        [DataMapping("LastName", DbType.String)]
        public string LastName { set; get; }

        [DataMapping("PicImgs", DbType.String)]
        public string PicImgs { set; get; }

        public string viewImage
        {
            get
            {
                string certImg = FileFactory.BrowerFile(PicImgs, ESourceType.FromBuyLeads, 100, 100);
                return string.IsNullOrEmpty(certImg) ? "/Themes/default/images/Img/noimage.jpg" : certImg;
            }
        }

        [DataMapping("UserID", DbType.Int32)]
        public int UserID { set; get; }

        [DataMapping("TempUserId", DbType.Int32)]
        public int TempUserId { set; get; }
    }
}
